package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author zzw
 * @date 2025/5/6
 * @description 菜品口味关系表
 */
@Mapper
public interface DishFlavorMapper {

    /**
     * 根据菜品id删除菜品口味
     *
     * @param dishIds 菜品id
     */
    void deleteByDishId(List<Long> dishIds);

    /**
     * 批量插入菜品口味数据
     *
     * @param flavors 菜品口味数据
     */
    void insertBatch(List<DishFlavor> flavors);

    /**
     * 根据菜品id查询对应的口味数据
     *
     * @param dishId 菜品id
     * @return 菜品口味数据
     */
    @Select("select * from dish_flavor where dish_id = #{dishId}")
    List<DishFlavor> getByDishId(Long dishId);
}
